<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例5</title>
</head>

<body>
    <div style="width: 400px;margin: 0 auto;">
        <input type="text" id="num">
        <button onclick="juged()">是否为两位数</button>
        <h1 id="result"></h1>
    </div>

    <script>
        let n = document.querySelector('#num')
        let r = document.querySelector('#result')

        function juged() {
            let temp = parseInt(n.value)
            r.innerText = temp >= 10 && temp <= 100 ? '是两位数' : '不是两位数'
        }
    </script>
</body>

</html>